#include "common.h"


using namespace Scenic::Renderer;


static ResourcePool canvasPool;

#ifdef DIRECTX
Canvas::Canvas(HWND hwnd)
: Resource(&canvasPool)
{
	this->hwnd = hwnd;
	device = new Device(hwnd);
}
#endif
#ifdef OPT_X11
Canvas::Canvas(Window window)
: Resource(&canvasPool)
{
	this->window = window;
	device = new Device(window);
}
#endif

Canvas::~Canvas()
{
	delete device;
}

void Canvas::reset()
{
	device->reset();
}

Canvas *Canvas::get(int id)
{
	return (Canvas*)canvasPool.get(id);
}
